core.log¶
This module bridges the Python standard logging module
with the slf4j library used by openHAB. The configuration
module provides
a LOG_PREFIX
variable that is used as the default logger throughout the
core modules and scripts.
-
class
core.log.
Slf4jHandler
(level=0)¶ Bases:
logging.Handler
-
emit
(record)¶ Do whatever it takes to actually log the specified logging record.
This version is intended to be implemented by subclasses and so raises a NotImplementedError.
-
-
core.log.
log_traceback
(fn)¶ Decorator to provide better Jython stack traces
Essentially, the decorated function/class/method is wrapped in a try/except and will log a traceback for exceptions. If openHAB Cloud Connector is installed, exceptions will be sent as a notification. If the configuration.adminEmail variable is populated, the notification will be sent to that address. Otherwise, a broadcast notification will be sent.